package mains;

import mains.RangPoker;
import mains.ReqAnalyseMain;

import rangs.RangBrelan;
import rangs.RangPaire;

public class Brelan extends AbstractAnalyseurRang{
	public Brelan() {
		super();
	}

	public boolean reconnaitreMain(ReqAnalyseMain requete) {
	  Main m = hasSameDenominationNTimes(requete.getMain(),3);
	  if(m != null){
		  RangBrelan brelan = new RangBrelan();
		  brelan.setBrelan(m);
		  
		  Main reste = requete.getMain();
		  requete.getMain().removeAll(m);
		  brelan.setReste(reste);

		  requete.setRangReconnu(brelan);
		  return true; 
	  }
	  return false;
	}
	
	public RangPoker getRang() {
		return RangPoker.BRELAN;
	}
}
